package com.xinxing.city.recoverycheck.modules;

import com.google.inject.AbstractModule;
import com.google.inject.Scopes;
import com.xinxing.city.recoverycheck.Constant;
import com.xinxing.city.recoverycheck.DeviceKernel;
import com.xinxing.city.recoverycheck.interfaces.IDeviceKernel;
import com.xinxing.city.recoverycheck.interfaces.IRfidManager;
import com.xinxing.city.recoverycheck.interfaces.ISerialSendReceiveData;
import com.xinxing.city.recoverycheck.serialport.RfidManager;
import com.xinxing.city.recoverycheck.serialport.RfidzhiManager;
import com.xinxing.city.recoverycheck.serialport.SerialSendReceiveData;
import com.xinxing.city.recoverycheck.serialport.Serialzhi;


public class RecoveryModules extends AbstractModule {
    @Override
    protected void configure() {
        binder().bind(IDeviceKernel.class).to(DeviceKernel.class).in(Scopes.SINGLETON);
        if(!Constant.MOCK) {
            binder().bind(ISerialSendReceiveData.class).to(SerialSendReceiveData.class).in(Scopes.SINGLETON);
            binder().bind(IRfidManager.class).to(RfidManager.class).in(Scopes.SINGLETON);
        }else{
            binder().bind(ISerialSendReceiveData.class).to(Serialzhi.class).in(Scopes.SINGLETON);
            binder().bind(IRfidManager.class).to(RfidzhiManager.class).in(Scopes.SINGLETON);
        }


    }
}
